/**
 *	@file	bc_app_def.h
 *	@brief	ボングリケース アプリデファイン
 *	@author	Miyuki Iwasawa
 *	@date	08.08.04
 *
 */

#ifndef __H_BC_APP_DEF_H__
#define __H_BC_APP_DEF_H__

///アプリシーケンス定義
typedef enum{
 SEQ_FADE_IN,
 SEQ_FADE_OUT,
 SEQ_1ST_MSG,
 SEQ_NORMAL_MAIN,
 SEQ_POT_MAIN,
 SEQ_BALL_MAIN,
 SEQ_BALL_NUMSET,
 SEQ_BONG_MOVE_KEY,
 SEQ_BONG_MOVE_TOUCH,
 SEQ_BONG_MOVE_END,
 SEQ_BONG_POT_SET,
 SEQ_LIST_JUICE,
 SEQ_LIST_DECIDE,
 SEQ_LIST_YESNO,
 SEQ_MSG_WAIT,
 SEQ_TALKMSG_WAIT,
 SEQ_EXIT,
};

///フレーム定義
#define UFRM_MSG	(GF_BGL_FRAME0_S)
#define UFRM_BACK	(GF_BGL_FRAME3_S)

#define DFRM_MSG	(GF_BGL_FRAME0_M)
#define DFRM_DESIGN	(GF_BGL_FRAME1_M)
#define DFRM_TEXT	(GF_BGL_FRAME2_M)
#define DFRM_BACK	(GF_BGL_FRAME3_M)

#define UFRM_MSG_PRI	(0)
#define UFRM_BACK_PRI	(3)
#define DFRM_MSG_PRI	(0)
#define DFRM_DESIGN_PRI	(1)
#define DFRM_TEXT_PRI	(2)
#define DFRM_BACK_PRI	(3)

//////////////////////////////////////////////////////
///メッセージ関連定義

#define WORDSET_BC_BUFLEN	(32)
#define WORDSET_BC_BUFNUM	(16)
#define BC_MSG_BUFLEN		(256)	///<メッセージ展開バッファ長

#define MSG_PARAM_NULL		(0)	///<メッセージ展開パラメータNULLコード

typedef enum{
 MIDX_SYS_NORMAL,	///<あつめたぼんぐりです
 MIDX_SYS_POT01,	///<ポットにいれられます
 MIDX_SYS_POT02,	///<まだシェイクが足りない
 MIDX_SYS_POT03,	///<そろそろできそう
 MIDX_SYS_POT04,	///<もうすこしで
 MIDX_SYS_POT05,	///<ジュースができました
 MIDX_SYS_STOCK01,	///<あと○こ入ります
 MIDX_SYS_STOCK02,	///<もう入りません
 MIDX_SYS_JUICE,	///<ジュースをどうしますか？
 MIDX_SYS_TASTE,	///<ジュースをちょっとなめた
 MIDX_SYS_BONG01,	///<わたすぼんぐりをえらんで
 MIDX_SYS_BONG02,	///<いくつ渡す？
 MIDX_SYS_BONG03,	///<○を○こでいいですか？
 MIDX_SYS_MAX,
}MSG_SYS_IDX;

typedef enum{
 MIDX_EXP_BONG01 = MIDX_SYS_MAX,
 MIDX_EXP_BONG02,
 MIDX_EXP_BONG03,
 MIDX_EXP_BONG04,
 MIDX_EXP_BONG05,
 MIDX_EXP_BONG06,
 MIDX_EXP_BONG07,
 MIDX_EXP_POT01,
 MIDX_EXP_POT02,
 MIDX_EXP_MAX,
}MSG_EXP_IDX;

typedef enum{
 MIDX_TALK_INI_1ST = MIDX_EXP_MAX,	///<初回
 MIDX_TALK_INI_NEW,	///<初回
 MIDX_TALK_INI_UPDATE,	///<初回
 MIDX_TALK_JUICE_NONE,	///<ジュースがない
 MIDX_TALK_POT_FULL,	///<これ以上入らない
 MIDX_TALK_JUICE_CREATE,	///<ジュース作成中
 MIDX_TALK_JUICE_REFORM,	///<ジュース改良中
 MIDX_TALK_MAX,
}MSG_TALK_IDX;

#define MSG_IDX_MAX	(MIDX_TALK_MAX)

///////////////////////////////////////////
///パレット定義
#define BACK_FONT_PAL	(9)
#define MSG_FONT_PAL	(9)
#define EXP_FONT_PAL	(11)
//ここまでnclの中
///////////////////////////////////
#define SBOX_PAL		(11)
#define SYS_FONT_PAL	(12)
#define TALK_FONT_PAL	(12)
#define BMP_TALK_WIN_PAL	(13)
#define YESNO_WIN_PAL		(14)	//2本占有

#define BC_OBJPAL_MAX	(16)

#define	FCOL_W_BLACK	( GF_PRINTCOLOR_MAKE( FBMP_COL_BLACK, FBMP_COL_BLK_SDW, FBMP_COL_WHITE ) )		// フォントカラー：黒
#define	FCOL_N_BLACK	( GF_PRINTCOLOR_MAKE( 3, 2, FBMP_COL_NULL ) )		// フォントカラー：黒
#define FCOL_SYS_N_BLACK	( GF_PRINTCOLOR_MAKE( FBMP_COL_BLACK, FBMP_COL_BLK_SDW, FBMP_COL_NULL ) )		// フォントカラー：黒
#define FCOL_SYS_N_WHITE	( GF_PRINTCOLOR_MAKE( FBMP_COL_WHITE, FBMP_COL_BLK_SDW, FBMP_COL_NULL ) )		// フォントカラー：白
#define FCOL_SYS_N_WHITE_FR	( GF_PRINTCOLOR_MAKE( FBMP_COL_WHITE, FBMP_COL_RED, FBMP_COL_NULL ) )		// フォントカラー：白枠
#define FCOL_SYS_N_WHITE_FB	( GF_PRINTCOLOR_MAKE( FBMP_COL_WHITE, FBMP_COL_GREEN, FBMP_COL_NULL ) )		// フォントカラー：白枠

//=======================================
///アルファ値設定
//=======================================
#define ALPHA_SECOND	(26)
#define ALPHA_FIRST		(6)

#define ALPHA_MASK_1ST	(GX_BLEND_PLANEMASK_NONE)
#define ALPHA_MASK_2ND	(GX_BLEND_PLANEMASK_BG3)

///////////////////////////////////////////
//アクター関連
#define BONGCASE_ACTRES_MAX	(3)	///<リソース数
#define BONGCASE_ACTPAL_NUM	(3)	///<管理パレット数

enum{
 ACT_BACK,
 ACT_CURSOR,
 ACT_BONG01,
 ACT_BONG02,
 ACT_BONG03,
 ACT_BONG04,
 ACT_BONG05,
 ACT_BONG06,
 ACT_BONG07,
 //↑共通
 ACT_POT_B,
 ACT_POT_T,
 ACT_BTN_D = ACT_POT_B,
 ACT_BTN_C,
 ACT_ALU01,
 ACT_ALD01,
 ACT_ALU02,
 ACT_ALD02,
 BONGCASE_ACTMAX,
};

//アクター管理数
#define BC_ACTOR_MAX	(BONGCASE_ACTMAX)

enum{
 ACT_SPRI_CURSOR,
 ACT_SPRI_EFF,
 ACT_SPRI_BONG_A,
 ACT_SPRI_BONG,
 ACT_SPRI_BACK,
 ACT_SPRI_POT_T,
 ACT_SPRI_POT_B,
 ACT_SPRI_BTN,
 ACT_SPRI_AL,
};

enum{
 ACTRES_NORMAL,
};

enum{
 ANM_BACK,
 ANM_BACKA,
 ANM_BACKP,
 ANM_CUR_N,
 ANM_CUR_R,
 ANM_CUR_C,
 ANM_CUR_P,
 ANM_CUR_E,
 ANM_SHADOW,
 ANM_B_RED,
 ANM_B_YELLOW,
 ANM_B_BLUE,
 ANM_B_GREEN,
 ANM_B_PINK,
 ANM_B_WHITE,
 ANM_B_BLACK,
 ANM_POT00,
 ANM_POT01,
 ANM_POT02,
 ANM_POT03,
 ANM_P_CLOSE,
 ANM_P_OPEN,
 ANM_PA_CLOSE,
 ANM_PA_OPEN,
 ANM_UP,
 ANM_UP_P,
 ANM_DW,
 ANM_DW_P,
 ANM_BTN_D01,
 ANM_BTN_D02,
 ANM_BTN_C01,
 ANM_BTN_C02,
};

typedef enum{
 BTN_ACTIVE,
 BTN_ANM,
 BTN_PASSIVE,
}BTN_STATE;

typedef enum{
 DC_BTN_DECIDE,
 DC_BTN_CANCEL,
}DC_BTN_ID;

#define ACT_BACK_PX	(28*8)
#define ACT_BACK_PY	(22*8)
#define ACT_CUR_BACK_OX	(16)
#define ACT_CUR_BACK_OY	(-8)

#define ACT_CUR_PX	(3*8+3)
#define ACT_CUR_PY	(12*8)
#define ACT_CUR_OX	(4)
#define ACT_CUR_OY	(-16)

#define ACT_BONG_PX01	(27)
#define ACT_BONG_PX02	(75)
#define ACT_BONG_PY01	(49)
#define ACT_BONG_PY02	(65)
#define ACT_BONG_OY		(32)

#define ACT_BONG01_PX	(ACT_BONG_PX01)
#define ACT_BONG01_PY	(ACT_BONG_PY01)
#define ACT_BONG02_PX	(ACT_BONG_PX02)
#define ACT_BONG02_PY	(ACT_BONG_PY02)
#define ACT_BONG03_PX	(ACT_BONG_PX01)
#define ACT_BONG03_PY	(ACT_BONG01_PY+ACT_BONG_OY)
#define ACT_BONG04_PX	(ACT_BONG_PX02)
#define ACT_BONG04_PY	(ACT_BONG02_PY+ACT_BONG_OY)
#define ACT_BONG05_PX	(ACT_BONG_PX01)
#define ACT_BONG05_PY	(ACT_BONG03_PY+ACT_BONG_OY)
#define ACT_BONG06_PX	(ACT_BONG_PX02)
#define ACT_BONG06_PY	(ACT_BONG04_PY+ACT_BONG_OY)
#define ACT_BONG07_PX	(ACT_BONG_PX01)
#define ACT_BONG07_PY	(ACT_BONG05_PY+ACT_BONG_OY)

#define ACT_POTT_PX	(24*8)
#define ACT_POTT_PY	(12*8)

#define ACT_POTB_PX	(ACT_POTT_PX)
#define ACT_POTB_PY	(19*8)
#define ACT_POTB_PAL	(5)

#define ACT_CUR_POT_OX	(8)
#define ACT_CUR_POT_OY	(-4)

#define ACT_BTN_PX	(20*8)
#define ACT_BTN_PY	(14*8)
#define ACT_BTN_OY	(24)

#define ACT_AL_PX	(13*8-1)
#define ACT_AL_OX	(-22)
#define ACT_AL_PY	(12*8)
#define ACT_AL_OY	(5*8)

///カーソル位置
enum{
 CURPOS_BONG01,
 CURPOS_BONG02,
 CURPOS_BONG03,
 CURPOS_BONG04,
 CURPOS_BONG05,
 CURPOS_BONG06,
 CURPOS_BONG07,
 CURPOS_POT,
 CURPOS_BACK,
 CURPOS_MAX,
};
enum{
 CLINE_A,
 CLINE_B,
 CLINE_C,
 CLINE_D,
};

///ボール作成個数入力実行コード
enum{
 EXE_NSET_DECIDE,
 EXE_NSET_CANCEL,
 EXE_NSET_UP1,
 EXE_NSET_DOWN1,
 EXE_NSET_UP10,
 EXE_NSET_DOWN10,
 EXE_NSET_NULL,
};

///ボングリ移動パラメータ
#define BONG_CUR_OFS_Y	(6)
#define BONG_CUR_OFS_X	(0)

enum{
 MOVE_TO_POT,
 MOVE_TO_BONG,
};

enum{
 MOVE_BONG,
 MOVE_CURSOR,
};




///////////////////////////////////////////
///BMPウィンドウ定義
enum{
 WIN_MSG,
 WIN_SYS,
 WIN_BACK,
 WIN_TITLE,
 WIN_EXP,
 WIN_BNAME,
 WIN_BTN01,
 WIN_BTN02,
 WIN_NUM01,
 WIN_NUM02,
 WIN_UNIT,
 WIN_BONG01,
 WIN_BONG02,
 WIN_BONG03,
 WIN_BONG04,
 WIN_BONG05,
 WIN_BONG06,
 WIN_BONG07,
 WIN_MAX,
};

///ウィンドウ関連キャラ領域指定(上下共用)
#define BMP_TALK_WIN_CGX	(1)

/////////////////////////////////////////////
//下画面用

//選択ボックスウィンドウ領域
#define SBOX_POT_CT	(3)
#define SBOX_BALL_CT	(2)
#define SBOX_WCGX	(BMP_TALK_WIN_CGX+TALK_WIN_CGX_SIZ)
#define SBOX_W		(8)
#define SBOX_FCGX_SIZ	(SBOX_W*2*SBOX_POT_CT)
#define SBOX_FCGX	(SBOX_WCGX+SBOX_WINCGX_SIZ)

#define SBOX_POT_PX		(22)
#define SBOX_POT_PY		(14)
#define SBOX_BALL_PX	(17)
#define SBOX_BALL_PY	(12)

//はい・いいえメニュー領域
#define	BMP_YESNO_PX	( 25 )
#define	BMP_YESNO_PY	( 5 )
#define BMP_YESNO_FRM	( DFRM_MSG )
#define	BMP_YESNO_PAL	( YESNO_WIN_PAL )
#define BMP_YESNO_CGX_SIZ	(TOUCH_SW_USE_CHAR_NUM)
#define	BMP_YESNO_CGX	( SBOX_FCGX+SBOX_FCGX_SIZ )

//メッセージ領域
#define	BMP_MSG_PX	( 5 )
#define	BMP_MSG_PY	( 9 )
#define	BMP_MSG_SX	( 22 )
#define	BMP_MSG_SY	( 6 )
#define BMP_MSG_FRM	( DFRM_MSG )
#define	BMP_MSG_PAL	( TALK_FONT_PAL )
#define BMP_MSG_CGX_SIZ	(BMP_MSG_SX*BMP_MSG_SY)
#define	BMP_MSG_CGX	( BMP_YESNO_CGX+BMP_YESNO_CGX_SIZ )

///システムメッセージ
#define	BMP_SYS_PX	( 3 )
#define	BMP_SYS_PY	( 1 )
#define	BMP_SYS_SX	( 28 )
#define	BMP_SYS_SY	( 2 )
#define BMP_SYS_FRM	( DFRM_TEXT )
#define	BMP_SYS_PAL	( SYS_FONT_PAL )
#define BMP_SYS_CGX_SIZ	(BMP_SYS_SX*BMP_SYS_SY)
#define	BMP_SYS_CGX	( BMP_MSG_CGX+BMP_MSG_CGX_SIZ )

///やめるボタン
#define	BMP_BACK_PX	( 25 )
#define	BMP_BACK_PY	( 21 )
#define	BMP_BACK_SX	( 6 )
#define	BMP_BACK_SY	( 2 )
#define BMP_BACK_FRM	( DFRM_TEXT )
#define	BMP_BACK_PAL	( BACK_FONT_PAL )
#define BMP_BACK_CGX_SIZ	(BMP_BACK_SX*BMP_BACK_SY)
#define	BMP_BACK_CGX	( BMP_SYS_CGX+BMP_SYS_CGX_SIZ )

///アプリタイトル
#define	BMP_TITLE_PX	( 2 )
#define	BMP_TITLE_PY	( 21 )
#define	BMP_TITLE_SX	( 10 )
#define	BMP_TITLE_SY	( 2 )
#define BMP_TITLE_FRM	( DFRM_TEXT )
#define	BMP_TITLE_PAL	( SYS_FONT_PAL )
#define BMP_TITLE_CGX_SIZ	(BMP_TITLE_SX*BMP_TITLE_SY)
#define	BMP_TITLE_CGX	( BMP_BACK_CGX+BMP_BACK_CGX_SIZ )

//ボール作成　ボングリ名表示
#define BMP_BNAME_PX	(9)
#define BMP_BNAME_PY	(7)
#define BMP_BNAME_SX	(8)
#define BMP_BNAME_SY	(2)
#define BMP_BNAME_FRM	(DFRM_MSG)
#define BMP_BNAME_CGX_SIZ	(BMP_BNAME_SX*BMP_BNAME_SY)
#define BMP_BNAME_CGX	(BMP_TITLE_CGX+BMP_TITLE_CGX_SIZ)
#define	BMP_BNAME_PAL	( SYS_FONT_PAL )

#define BMP_BTN_PX	(17)
#define BMP_BTN01_PY	(13)
#define BMP_BTN02_PY	(16)
#define BMP_BTN_SX	(6)
#define BMP_BTN_SY	(2)
#define BMP_BTN_FRM	(DFRM_MSG)
#define BMP_BTN_CGX_SIZ	(BMP_BTN_SX*BMP_BTN_SY)
#define BMP_BTN01_CGX	(BMP_BNAME_CGX+BMP_BNAME_CGX_SIZ)
#define BMP_BTN02_CGX	(BMP_BTN01_CGX+BMP_BTN_CGX_SIZ)
#define	BMP_BTN_PAL	( SYS_FONT_PAL )

#define BMP_NUM01_PX	(12)
#define BMP_NUM02_PX	(9)
#define BMP_NUM_PY	(13)
#define BMP_NUM_SX	(2)
#define BMP_NUM_SY	(3)
#define BMP_NUM_FRM	(DFRM_MSG)
#define BMP_NUM_CGX_SIZ	(BMP_NUM_SX*BMP_NUM_SY)
#define BMP_NUM01_CGX	(BMP_BTN02_CGX+BMP_BTN_CGX_SIZ)
#define BMP_NUM02_CGX	(BMP_NUM01_CGX+BMP_NUM_CGX_SIZ)
#define	BMP_NUM_PAL	( SYS_FONT_PAL )

#define BMP_UNIT_PX	(14)
#define BMP_UNIT_PY	(14)
#define BMP_UNIT_SX	(2)
#define BMP_UNIT_SY	(2)
#define BMP_UNIT_FRM	(DFRM_MSG)
#define BMP_UNIT_CGX_SIZ	(BMP_UNIT_SX*BMP_UNIT_SY)
#define BMP_UNIT_CGX	(BMP_NUM02_CGX+BMP_NUM_CGX_SIZ)
#define	BMP_UNIT_PAL	( SYS_FONT_PAL )

//ボングリ個数表示
#define BMP_BONG_PX	(5)
#define BMP_BONG_PY	(6)
#define BMP_BONG_OX		(6)
#define BMP_BONG_OY		(2)
#define BMP_BONG_SX		(2)
#define BMP_BONG_SY		(2)
#define BMP_BONG_FRM	(DFRM_TEXT)
#define BMP_BONG_CGX_SIZ	(BMP_BONG_SX*BMP_BONG_SY)
#define BMP_BONG_CGX	(BMP_UNIT_CGX+BMP_UNIT_CGX_SIZ)
#define	BMP_BONG_PAL	( SYS_FONT_PAL )




////////////////////////////////////////////
//上画面
///説明ウィンドウタイトル
#define	BMP_EXP_PX	( 2 )
#define	BMP_EXP_PY	( 17 )
#define	BMP_EXP_SX	( 28 )
#define	BMP_EXP_SY	( 6 )
#define BMP_EXP_FRM	( UFRM_BACK )
#define	BMP_EXP_PAL	( TALK_FONT_PAL )
#define BMP_EXP_CGX_SIZ	(BMP_EXP_SX*BMP_EXP_SY)
#define	BMP_EXP_CGX	( 1024-BMP_EXP_CGX_SIZ )


///////////////////////////////////////////
//パッシブモード
typedef enum{
	BONG_STATE_ACTIVE,
	BONG_STATE_PASSIVE,
	BONG_STATE_TARGET_ONLY,
}BONG_STATE;

///////////////////////////////////////////
//デバッグ用

#ifdef PM_DEBUG

typedef enum{
 DMIDX_TIME01,	//
 DMIDX_TIME02,	//
 DMIDX_SEED01,	//
 DMIDX_SEED02,	//
 DMIDX_NOTHING,	//
 DMIDX_MAX,
}DEB_MSG_IDX;

enum{
 DEB_WIN_JUICE,
 DEB_WIN_MAX,
};
#define	BMP_DEBJ_PX	( 1 )
#define	BMP_DEBJ_PY	( 1 )
#define	BMP_DEBJ_SX	( 30 )
#define	BMP_DEBJ_SY	( 14 )
#define BMP_DEBJ_FRM	( UFRM_MSG )
#define	BMP_DEBJ_PAL	( 15 /*MSG_FONT_PAL*/ )
#define BMP_DEBJ_CGX_SIZ	(BMP_DEBJ_SX*BMP_DEBJ_SY)
#define	BMP_DEBJ_CGX	( 1024-BMP_DEBJ_CGX_SIZ )

#define	BMP_DEBS_PX	( 1 )
#define	BMP_DEBS_SX	( 30 )
#define	BMP_DEBS_SY	( 4 )
#define BMP_DEBS_FRM	( UFRM_MSG )
#define	BMP_DEBS_PAL	( 15 /*MSG_FONT_PAL*/ )
#define BMP_DEBS_CGX_SIZ	(BMP_DEBT_SX*BMP_DEBT_SY)

#define	BMP_DEBS_PY01	( 8 )
#define	BMP_DEBS_PY02	( BMP_DEBS_PY01 + BMP_DEBS_SY)
#define	BMP_DEBS_PY03	( BMP_DEBS_PY02 + BMP_DEBS_SY)
#define	BMP_DEBS_PY04	( BMP_DEBS_PY03 + BMP_DEBS_SY)
#define	BMP_DEBS_CGX01	( BMP_DEBT_CGX+BMP_DEBT_CGX_SIZ )
#define	BMP_DEBS_CGX02	( BMP_DEBS_CGX01+BMP_DEBS_CGX_SIZ )
#define	BMP_DEBS_CGX03	( BMP_DEBS_CGX02+BMP_DEBS_CGX_SIZ )
#define	BMP_DEBS_CGX04	( BMP_DEBS_CGX03+BMP_DEBS_CGX_SIZ )

#endif	//PM_DEBUG

/////////////////////////////////////////////
//タッチパネル関連
/////////////////////////////////////////////
#define TP_BACK_X	(24*8)
#define TP_BACK_Y	(20*8)
#define TP_BACK_W	(8*8)
#define TP_BACK_H	(4*8)

#define TP_POT_X	(19*8)
#define TP_POT_Y	(9*8)
#define TP_POT_W	(10*8)
#define TP_POT_H	(11*8)

#define TP_BONG_X1	(24+2)
#define TP_BONG_X2	(72+2)
#define TP_BONG_Y	(6*8)
#define	TP_BONG_OY	(16)
#define TP_BONG_R	(12*2)

#define TP_BONG01_X	(TP_BONG_X1)

#define TP_BONG01_Y	(TP_BONG_Y)
#define TP_BONG02_Y	(TP_BONG01_Y+TP_BONG_OY)
#define TP_BONG03_Y	(TP_BONG02_Y+TP_BONG_OY)
#define TP_BONG04_Y	(TP_BONG03_Y+TP_BONG_OY)
#define TP_BONG05_Y	(TP_BONG04_Y+TP_BONG_OY)
#define TP_BONG06_Y	(TP_BONG05_Y+TP_BONG_OY)
#define TP_BONG07_Y	(TP_BONG06_Y+TP_BONG_OY)

#define TP_SEED_X	(16)
#define TP_SEED_W	(22)
#define TP_SEED_OX	(6+TP_SEED_W)
#define TP_SEED_Y0	(11*8)
#define TP_SEED_Y1	(9*8)
#define TP_SEED_H0	(24)
#define TP_SEED_H1	(32)

#define TP_BTN_X	(17*8)
#define TP_BTND_Y	(13*8)
#define TP_BTNC_Y	(16*8)
#define TP_BTN_H	(2*8)
#define TP_BTN_W	(6*8)

#define TP_AL_X1	(12*8-2)
#define TP_AL_X2	(9*8+2)
#define TP_AL_Y1	(11*8)
#define TP_AL_Y2	(16*8)
#define TP_AL_H		(16)
#define TP_AL_W		(14)


#endif	//__H_BC_APP_DEF_H__

